package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface EmployeeMapper {

    /**
     * 新增员工
     *
     * @param employee 员工实体类
     */
    @AutoFill(value = OperationType.INSERT)
    void insertEmployee(Employee employee);

    /**
     * 根据id删除员工
     * @param employeeId 员工Id
     */
    void deleteEmployeeById(Long employeeId);

    /**
     * 修改员工表信息
     * @param employee 员工实体类
     */
    @AutoFill(value = OperationType.UPDATE)
    void updateEmployee(Employee employee);

    /**
     * 分页查询
     *
     * @param employeePageQueryDTO 员工分页查询DTO类
     * @return 查询到的员工数据
     */
    Page<Employee> pageQueryEmployee(EmployeePageQueryDTO employeePageQueryDTO);

    /**
     * 根据用户名查询员工
     *
     * @param username 员工账号
     * @return 员工实体类
     */
    Employee getEmployeeByUsername(String username);


    /**
     * 根据员工查询信息
     *
     * @param id 员工id
     * @return 员工实体类
     */
    Employee getEmployeeById(Long id);


}